"""
    Default implementation of MultiGenerator

    Use: python.exe -m S3D.MultiGenerator paths.txt

    paths.txt:
        <search-path-1>
        <search-path-2>
        -<exlude-path>
"""

from S3D.MultiGenerator import MultiGenerator
import sys

if __name__ == '__main__' and not 'testLoader' in vars():
    if len(sys.argv) != 2:
        print("Error: Paths filename expected")
        print("Use: python.exe -m S3D.MultiGenerator paths.txt")
        sys.exit(-1)

    m = MultiGenerator()

    with open(sys.argv[1]) as f:
        while True:
            line = f.readline()
            if not line:
                break

            line = line.strip()
            if len(line) == 0:
                continue
            if line[0] == '-':
                m.excludePath.append(line[1:])
            else:
                m.searchPath.append(line)

    if not m.execute():
        sys.exit(-1)